/**
 * 
 */
package com.cci.kangdao.controller;

import java.io.UnsupportedEncodingException;

import javax.mail.MessagingException;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cci.kangdao.utilTool.MailUtil;

/**
 * @description:
 * @author: wang ying
 * @company: Persagy Technology Co.,Ltd
 * @since: 2022年1月14日 上午11:21:43
 * @version: V1.0
 **/
@Controller
public class EmailTestController {
	
	
	
	@RequestMapping("set.aspx")
	public String set(String starttlsEnable, String enablePort) {
		MailUtil.set(starttlsEnable, enablePort);
		return "success";
	}
	
	
	
	@RequestMapping("send.aspx")
	@ResponseBody
	public String send(String email, String starttlsEnable) {
		
		try {
			MailUtil.sendMail(email, "主题", "111111111111111");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		} catch (MessagingException e) {
			e.printStackTrace();
		}
		
		return "success";
	}
	
}
